<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
	<title>page title</title>
	<meta name="keywords" content="">
    <meta name="description" content="">
    <link type="text/css" rel="stylesheet" href="plugins/YunUI/yun.css"></style>
	<!--[if lt IE 9]>
    	<script src="https://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
    <![endif]-->
</head>
<body>
	<table id="table"></table>
	<div id="page"></div>
	<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.js"></script>
	<script src="plugins/YunUI/yun.js"></script>
	<script>
		$Y.grid({
			id:'table',
			obj:'test/page',
			checkbox:false,
			rownumber:true,
			size:4,
			pagesize:[4,10,20],
			index:1,
			pager:"page",
			key:"id",
			columns: [
	            {
	                field: "id",
	                title: "ID"
	            },
	            {
	                field: "title",
	                title: "标题"
	            },
	            {
	                field: "status",
	                title: "状态",
	                formatter: function (v) {
	                    return v ? "启用" : "锁定";
	                }
	            },
				{
					type:"customer",
					title:"操作",
					formatter:function(v){
					var res = "<a style='margin:3px;' href='test/detail/"+v+"'>编辑</a>";
	                    res += "<a style='margin:3px;' href='test/delete/"+v+"'>删除</a>";
	                    return res;
					}
				}
			]
		});
	</script>
</body>
</html>